package config

type PortalApiConfig struct {
	Name      string          `yaml:"name"`
	Host      string          `yaml:"host"`
	Port      int             `yaml:"port"` // for test
	TokenName string          `yaml:"tokenname"`
	Tags      []string        `yaml:"tags"`
	JWTConfig JWTConfig       `yaml:"jwt"`
	PortalRpc PortalRpcConfig `yaml:"portal_rpc"`
	RabbitMQ  RabbitMQConfig  `yaml:"rabbitmq"`
	TxQueue   QueueConfig     `yaml:"txqueue"`
	Consul    ConsulConfig    `yaml:"consul"`
	Jaeger    JaegerConfig    `yaml:"jaeger"`
}

type JWTConfig struct {
	SigningKey string `yaml:"key"`
}

type PortalRpcConfig struct {
	Name string `yaml:"name"`
	Tag  string `yaml:"tag"`
}

type RedisConfig struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Password string `yaml:"password"`
	DB       int    `yaml:"db"`
}

type RabbitMQConfig struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
}

type QueueConfig struct {
	Queue      string `yaml:"queue"`
	Exchange   string `yaml:"exchange"`
	BindingKey string `yaml:"bindingKey"`
}

type ConsulConfig struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

type JaegerConfig struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
	Name string `yaml:"name"`
}

type NacosConfig struct {
	Host        string `mapstructure:"host"`
	Port        uint64 `mapstructure:"port"`
	NamespaceId string `mapstructure:"namespaceId"`
	TimeoutMs   uint64 `mapstructure:"timeoutMs"`
	LogDir      string `mapstructure:"logDir"`
	CacheDir    string `mapstructure:"cacheDir"`
	MaxSize     int    `mapstructure:"maxSize"`
	MaxBackups  int    `mapstructure:"maxBackups"`
	MaxAge      int    `mapstructure:"maxAge"`
	LogLevel    string `mapstructure:"logLevel"`
	AppName     string `mapstructure:"appName"`
	ContextPath string `mapstructure:"contextPath"`
	Username    string `mapstructure:"username"`
	Password    string `mapstructure:"password"`
	DataID      string `mapstructure:"dataId"`
	Group       string `mapstructure:"group"`
}
